function L = chi2dist(H1,H2)
H = H1+H2;
H(H == 0) = 1;
L = sum((H1-H2).^2./(H))/2;